<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateIntegralDetailsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('integral_details', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('user_id')       ->default(0)->comment('积分接受者');
            $table->bigInteger('question_id')   ->default(0)->comment('题目id（答题）');
            $table->bigInteger('course_id')     ->default(0)->comment('课程id(签到)');
            $table->string('order_num')         ->default('')->comment('订单号（邀请购买）');
            $table->string('type')          ->default('')->comment('类型:add获得，use使用');
            $table->integer('integral_num') ->default(0)->comment('积分数量');
            $table->string('remark')        ->default('')->comment('备注');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
//        Schema::dropIfExists('integral_details');
    }
}
